+\vspace{0.3cm}
+
+\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
+
+\vspace{0.6cm}
+\subsubsection{RPC name:~migrate}
+
+{\bf Overview:}
+Migrate the VM to another host. This can only be called when the specified
+VM is in the Running state.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void migrate (session_id s, VM ref vm, string dest, bool live, (string -> string) Map options)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & vm & The VM \\ \hline
+
+{\tt string } & dest & The destination host \\ \hline
+
+{\tt bool } & live & Live migration \\ \hline
+
+{\tt (string $\rightarrow$ string) Map } & options & Other parameters \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
\vspace{0.3cm}
\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
+/**
+ * Migrate the VM to another host. This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
+
+
/**
* Return a list of all the VMs known to the system.
*/
}
+bool
+xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm },
+ { .type = &abstract_type_string,
+ .u.string_val = dest },
+ { .type = &abstract_type_bool,
+ .u.bool_val = live },
+ { .type = &abstract_type_string_string_map,
+ .u.set_val = (arbitrary_set *)options }
+ };
+
+ xen_call_(session, "VM.migrate", param_values, 4, NULL, NULL);
+ return session->ok;
+}
+
+
bool
xen_vm_get_all(xen_session *session, struct xen_vm_set **result)
{